package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import javax.persistence.*;

/**
 * @SortBetween
 * @类型中间(sort_between)
 * @version : Ver 1.0
 */
@Entity
public class SortBetween implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:
	 * @字段:id BIGINT(19)
	 */
	@Id
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	@GenericGenerator(name="auto-identity",strategy="identity")
	@Column(updatable = false, columnDefinition="BIGINT(19) COMMENT ''")
	private java.lang.Long id;

	/**
	 * @备注:订单id
	 * @字段:order BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="orders", columnDefinition="BIGINT(19) COMMENT '订单id'")
	private Order orders;

	/**
	 * @备注:商家id
	 * @字段:shop BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="shop", columnDefinition="BIGINT(19) COMMENT '商家id'")
	private User shop;

	/**
	 * @备注:
	 * @字段:sort_type_id BIGINT(19)
	 */
	@ManyToOne
	@JoinColumn(name="sort_type_id", columnDefinition="BIGINT(19) COMMENT ''")
	private SortType sortTypeId;


	/**
	 * @备注:
	 * @字段:type BIGINT(19)
	 */
	@Column(columnDefinition="VARCHAR(100) COMMENT '用户昵称/店铺名称'")
	private Integer type;

	/**
	 * @备注:答题时间
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@Column(updatable = false, columnDefinition="DATETIME(19) COMMENT '答题时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime = new java.util.Date();

	/**
	 * @备注:修改时间
	 * @字段:upt_datetime DATETIME(19)
	 */
	@Column(columnDefinition="DATETIME(19) COMMENT '修改时间'")
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime = new java.util.Date();

	public SortBetween(){
	}

	public SortBetween(
		java.lang.Long id
	){
		this.id = id;
	}



	public void setId(java.lang.Long id) {
		this.id = id;
	}

	public java.lang.Long getId() {
		return this.id;
	}


	public Order getOrders() {
		return orders;
	}

	public void setOrders(Order orders) {
		this.orders = orders;
	}

	public SortType getSortTypeId() {
		return sortTypeId;
	}

	public void setSortTypeId(SortType sortTypeId) {
		this.sortTypeId = sortTypeId;
	}

	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}

	public User getShop() {
		return shop;
	}

	public void setShop(User shop) {
		this.shop = shop;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
}
